package com.lemon.boot.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lemon.boot.common.entity.LoginUserDetail;
import com.lemon.boot.dto.UserDTO;
import com.lemon.boot.po.UserPO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 用户表数据访问层
 *
 * @author 李猛
 * @since 2024-02-11
 */
public interface UserDAO extends BaseMapper<UserPO> {
    List<LoginUserDetail> getByUsername(Map<String, Object> param);

    Map<String, Object> getByCurrentId(@Param("id") Long id);

    void updateIpAndLoginTime(@Param("ip") String ip, @Param("id") Long id);

    UserPO get(Long id);

    Page<UserPO> getPage(UserDTO userDTO);

    List<UserPO> getByDeptId(@Param("deptId") Long deptId);
}
